| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- import { Grid, Tab, Tabs, Typography } from '@mui/material';
- import { Box, Container } from '@mui/system';
- import Image from 'next/image';
- import React, { useState } from 'react';
- import ProductCard from '../../components/product-card/ProductCard';
- import TabPanel from '../../components/tab-panel/TabPanel';
-
- const SingleProduct = () => {
- const [value, setValue] = useState(0);
-
- const handleChange = (event, newValue) => {
- setValue(newValue);
- };
-
- function a11yProps(index) {
- return {
- id: `simple-tab-${index}`,
- 'aria-controls': `simple-tabpanel-${index}`,
- };
- }
-
- return (
- <Box
- sx={{
- width: '100%',
- height: '100%',
- display: 'flex',
- flexDirection: 'column',
- }}
- >
- <Container
- sx={{
- width: '1273px',
- }}
- >
- <Typography
- fontFamily={'body1.fontFamily'}
- fontSize="32px"
- sx={{ mt: 25, height: '100%', color: 'primary.main' }}
- >
- Minimalist Printed Mug
- </Typography>
- <Grid container spacing={2} sx={{ height: '100%', width: '100%' }}>
- <Grid item lg={6}>
- <Image
- src="/images/product-card-image.jpg"
- alt="product"
- width={630}
- height={390}
- />
- </Grid>
- <Grid item lg={6}>
- <Tabs
- sx={{
- '& button:focus': {
- borderTop: '1px solid black',
- borderLeft: '1px solid black',
- borderRight: '1px solid black',
- borderRadius: '5px 5px 0 0',
- borderBottom: 'none',
- },
- }}
- value={value}
- onChange={handleChange}
- aria-label="basic tabs example"
- >
- <Tab
- sx={{
- width: '50%',
- }}
- label="Purchase"
- {...a11yProps(0)}
- />
- <Tab sx={{ width: '50%' }} label="Category" {...a11yProps(1)} />
- </Tabs>
- <TabPanel value={value} index={0}>
- <Box display="flex" flexDirection="row" justifyContent="right">
- <Box>
- <Typography>
- Our simple and sturdy mugs are made to last. With a
- minimalist desings you will soon be enjoying your next brew.
- </Typography>
- </Box>
- <Box
- justifyContent="flex-end"
- sx={{ display: 'flex', flexDirection: 'column' }}
- >
- <Typography align="right">$20</Typography>
- </Box>
- </Box>
- </TabPanel>
- <TabPanel value={value} index={1}>
- Mugs & Cups
- </TabPanel>
- </Grid>
- </Grid>
-
- <Typography
- sx={{ mt: 25, mb: 5, color: 'primary.main', fontSize: '32px' }}
- >
- Other Product You May Like
- </Typography>
- <Grid container spacing={2} sx={{ height: '100%', width: '100%' }}>
- <Grid item lg={4}>
- <ProductCard />
- </Grid>
- <Grid item lg={4}>
- <ProductCard />
- </Grid>
- <Grid item lg={4}>
- <ProductCard />
- </Grid>
- </Grid>
- </Container>
- </Box>
- );
- };
-
- export default SingleProduct;
|